Screenshots use `%Y-%m-%d %H-%M-%S` for the timestamp, which has the
advantage of allowing proper lexicographical sorting.
The screencast file name pattern, on the other hand, uses
locale-dependent expansions, which break sorting based on file name, and
introduces the chance of potentially invalid characters on different
file systems.
Fixes: #5115
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2300>
break;
case 'd': {
const datetime = GLib.DateTime.new_now_local();
- const datestr = datetime.format('%0x');
- const datestrEscaped = datestr.replace(/\//g, '-');
+ const datestr = datetime.format('%Y-%m-%d');
- filename += datestrEscaped;
+ filename += datestr;
break;
}
case 't': {
const datetime = GLib.DateTime.new_now_local();
- const datestr = datetime.format('%0X');
- const datestrEscaped = datestr.replace(/\//g, ':');
+ const datestr = datetime.format('%H-%M-%S');
- filename += datestrEscaped;
+ filename += datestr;
break;
}